package P1000;

import java.util.Scanner;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-10-14 13:13
 */
public class P1067_多项式输出 {
    //-x^99-7x^50+100x^2+x+8
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int index = scanner.nextInt();
        StringBuilder sb = new StringBuilder();
        int run = index;
        while(run > 1){
            int now = scanner.nextInt();
            if(now == 0) {
                --run;
                continue;
            }
            if(now == 1) {
                sb.append(String.format("+x^%d",run));
            }else if(now == -1){
                sb.append(String.format("-x^%d",run));
            }else{
                if(now > 0){
                    sb.append(String.format("+%dx^%d",now,run));
                }else{
                    sb.append(String.format("%dx^%d",now,run));
                }
            }
            --run;
        }
        int last = scanner.nextInt();
        if(last > 0){
            if(last == 1){
                sb.append("+x");
            }else{
                sb.append(String.format("+%dx",last));
            }
        }else if(last < 0){
            if(last == -1){
                sb.append("-x");
            }else{
                sb.append(String.format("%dx",last));
            }
        }
        last = scanner.nextInt();
        if(last > 0){
            sb.append('+').append(last);
        }else if(last < 0){
            sb.append(last);
        }
        scanner.close();
        if(sb.charAt(0) == '+'){
            sb.deleteCharAt(0);
        }
        System.out.println(sb.toString());
    }
}
